package springboot.doMain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.NoArgsConstructor;
import springboot.Tools.time;

import java.io.Serializable;

/**
 * client_group_by_day_data
 * blue grey
 */
@Data
@NoArgsConstructor
public class ClientGroupByDayData implements Serializable {
	/**
	 * client_by_day_data
	 */
	private Long id;
	
	/*用户id*/
	private String userId;
	/**
	 * client_by_day_data
	 */
	private String dateString;
	
	/**
	 * 新增客户群数量
	 */
	private int newChatCnt;
	
	
	/**
	 * 截至当天客户群总数量
	 */
	private int chatTotal;
	
	/**
	 * 截至当天有发过消息的客户群数量
	 */
	private int chatHasMsg;
	
	/**
	 * 客户群新增群人数
	 */
	private int newMemberCnt;
	
	/**
	 * 截至当天客户群总人数
	 */
	private int memberTotal;
	
	/**
	 * 截至当天有发过消息的群成员数
	 */
	private int memberHasMsg;
	
	/**
	 * 截至当天客户群消息总数
	 */
	private int msgTotal;
	
	/**
	 * 大群日活
	 */
	private int bigGroupTotal;
	
	/*是否为工作日*/
	private int isWorkDay;
	
	/*日期*/
	private Long date;
	
	
	public ClientGroupByDayData(Object o) {
		
		
		JSONObject data = JSON.parseObject(o + "");
		JSONObject obj = data.getJSONObject("data");
		this.setId(data.getLong("stat_time"));
		
		
		this.dateString = time.dateFormat(time.StringToFormatDate(data.getString("stat_time")), 2);
		this.chatTotal = obj.getInteger("chat_total");
		this.chatHasMsg = obj.getInteger("chat_has_msg");
		this.memberHasMsg = obj.getInteger("member_has_msg");
		this.memberTotal = obj.getInteger("member_total");
		this.newChatCnt = obj.getInteger("new_chat_cnt");
		this.msgTotal = obj.getInteger("msg_total");
		this.newMemberCnt = obj.getInteger("new_member_cnt");
		
	}
}
